package com.bluenave.crm.core.domain;

import org.apache.commons.lang3.Validate;

import javax.persistence.*;
import java.io.Serializable;

/**
 * Created by IntelliJ IDEA.
 * User: aleksanderbrancewicz
 * Date: 7/24/11
 * Time: 12:39 PM
 * To change this template use File | Settings | File Templates.
 */

@Entity
@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
@DiscriminatorColumn(name = "TYPE", discriminatorType = DiscriminatorType.INTEGER)
public class Contact implements Serializable{

    private Integer id;
    private String email = null;
    private boolean isActive = true;
    private String phoneNumber = null;

    public Contact() {}

    public Contact(String email, boolean active, String phoneNumber) {
        this.email = email;
        this.phoneNumber = phoneNumber;
        isActive = active;
    }

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY )
    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    @Column(name = "IS_ACTIVE")
    public boolean isActive() {
        return isActive;
    }

    public void setActive(boolean active) {
        isActive = active;
    }

    @Column(name = "PHONE")
    public String getPhoneNumber() {
        return phoneNumber;
    }

    public void setPhoneNumber(String phoneNumber) {
        this.phoneNumber = phoneNumber;
    }
}
